import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from sklearn.metrics import adjusted_rand_score, normalized_mutual_info_score

from config.config import *
from sklearn.decomposition import PCA
import seaborn as sns
# original_df = pd.read_csv(opj(merge_data_path,'total.csv'))
# clinic_data =pd.read_csv(clinic_data_path)

# original_df = original_df.merge(clinic_data, on=exclude_columns, how='inner')
# original_X = original_df.drop(columns=exclude_columns, axis=1)
# original_y = original_df[target_column]

# 1️⃣ 获取数据
signature_df = pd.read_csv(signature_score_csv_path)
signature_X = signature_df.drop(columns=exclude_columns)
signature_y = signature_df[target_column]

sns.pairplot(signature_df.drop(columns=['Patient_ID']),hue="ALN status",diag_kind="kde")
plt.savefig('demo.png')

#
# # 3. PCA降维可视化
# original_pca = PCA(n_components=2)
# X_original_pca = original_pca.fit_transform(original_X)
#
# signature_pca = PCA(n_components=2)
# X_signature_pca = signature_pca.fit_transform(signature_X)
#
# plt.figure(figsize=(12,5))
#
# plt.subplot(1, 2, 1)
# plt.scatter(X_original_pca[:, 0], X_original_pca[:, 1], c=original_y, cmap='viridis', s=50)
# plt.title('Original Data Distribution (PCA 2D)')
# plt.xlabel('PCA Component 1')
# plt.ylabel('PCA Component 2')
#
# plt.subplot(1, 2, 2)
# plt.scatter(X_signature_pca[:, 0], X_signature_pca[:, 1], c=signature_y, cmap='coolwarm', s=50)
# plt.title('Signature Data Distribution (PCA 2D)')
# plt.xlabel('PCA Component 1')
# plt.ylabel('PCA Component 2')
#
# plt.tight_layout()
# plt.show()